package com.google.sydym6.view.activities;

import com.google.sydym6.R;
import com.google.sydym6.controllers.IPlayRadioController;
import com.google.sydym6.controllers.PlayRadioController;
import com.google.sydym6.logic.IRadioScrobblerModel;
import com.google.sydym6.logic.RadioScrobblerModel;
import com.google.sydym6.logic.observers.IPlayerStateObservable;
import com.google.sydym6.logic.observers.IPlayerStateObserver;
import com.google.sydym6.logic.observers.IRecognizeStatusObservable;
import com.google.sydym6.logic.observers.IRecognizeStatusObserver;
import com.google.sydym6.view.adapters.RadioListPagerAdapter;
import com.google.sydym6.view.adapters.RadioPlayerPagerAdapter;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

public class RadioListActivity extends AbstractMiniPlayerActivity{

	  @Override
	  protected void onCreate(Bundle savedInstanceState) {
		Log.v("AbstractMiniPlayerActivity", "enter RadioListActivity onCreate");
	    RadioScrobblerModel.setContext(getApplicationContext());
	    model = RadioScrobblerModel.getInstance();
	    super.onCreate(savedInstanceState);
	    
	    setContentView(R.layout.radio_lists_layout);
	    initializeMiniPlayer();
	    
	  }
	  
	  @Override
	  protected void onResume() {
		  super.onResume();
		  
		  pager = (ViewPager) findViewById(R.id.radioListPager);
		    pagerAdapter = new RadioListPagerAdapter(getSupportFragmentManager());
		    pager.setAdapter(pagerAdapter);

		    pager.setOnPageChangeListener(new OnPageChangeListener() {

		      @Override
		      public void onPageSelected(int position) {
		        Log.d(TAG, "onPageSelected, position = " + position);
		      }

		      @Override
		      public void onPageScrolled(int position, float positionOffset,
		          int positionOffsetPixels) {
		      }

		      @Override
		      public void onPageScrollStateChanged(int state) {
		      }
		    });
	  }
}
